package com.pjs.tdd;

import java.util.Collection;
import java.util.Collections;

public class TransactionCollectionImpl implements TransactionCollection {
	
	private Collection<Transaction> transactions;
	
	public TransactionCollectionImpl() {
		super();
	}
	
	public TransactionCollectionImpl(final Collection<Transaction> transactions) {
		super();
		this.transactions=transactions;
	}
	
	@Override
	public int size(){
		return transactions.size();
	}
	
	@Override
	public void add(Transaction transaction){
		transactions.add(transaction);
	}
	
	@Override
	public void remove(Transaction transaction){
		transactions.remove(transaction);
	}
	
	public Collection<Transaction> transactions(){
		return Collections.unmodifiableCollection(this.transactions);
	}

	public void setTransactions(Collection<Transaction> transactions) {
		this.transactions = transactions;
	}
	
}
